UNIT MacTCPCommonTypes;

INTERFACE

	USES MemTypes;

{ MacTCP return Codes in the range -23000 through -23049 }
CONST
	inProgress				=	1;				{ I/O in progress }

	ipBadLapErr				=	-23000;			{ bad network configuration }
	ipBadCnfgErr			=	-23001;			{ bad IP configuration error }
	ipNoCnfgErr				=	-23002;			{ missing IP or LAP configuration error }
	ipLoadErr				=	-23003;			{ error in MacTCP load }
	ipBadAddr				=	-23004;			{ error in getting address }
	connectionClosing		=	-23005;			{ connection is closing }
	invalidLength			=	-23006;
	connectionExists		=	-23007;			{ request conflicts with existing connection }
	connectionDoesntExist	=	-23008;			{ connection does not exist }
	insufficientResources	=	-23009;			{ insufficient resources to perform request }
	invalidStreamPtr		=	-23010;
	streamAlreadyOpen		=	-23011;
	connectionTerminated	=	-23012;
	invalidBufPtr			=	-23013;
	invalidRDS				=	-23014;
	invalidWDS				=	-23014;
	openFailed				=	-23015;
	commandTimeout			=	-23016;
	duplicateSocket			=	-23017;

{ Error codes from internal IP functions }
	ipOpenProtErr			=	-23030;			{ can't open new protocol, table full }
	ipCloseProtErr			=	-23031;			{ can't find protocol to close }
	ipDontFragErr			=	-23032;			{ Packet too large to send w/o fragmenting }
	ipDestDeadErr			=	-23033;			{ destination not responding }
	ipBadWDSErr				=	-23034;			{ error in WDS format }
	icmpEchoTimeoutErr 		=	-23035;			{ ICMP echo timed-out }
	ipNoFragMemErr			=	-23036;			{ no memory to send fragmented pkt }
	ipRouteErr				=	-23037;			{ can't route packet off-net }

	nameSyntaxErr 			=	-23041;	
	cacheFault				=	-23042;
	noResultProc			=	-23043;
	noNameServer			=	-23044;
	authNameErr				=	-23045;
	noAnsErr				=	-23046;
	dnrErr					=	-23047;
	outOfMemory				=	-23048;

	BYTES_16WORD   			=	2;				{ bytes per 16 bit ip word }
	BYTES_32WORD    		=	4;				{ bytes per 32 bit ip word }
	BYTES_64WORD    		=	8;				{ bytes per 64 bit ip word }
	
TYPE
	b_8		=	SignedByte;			{ 8-bit quantity }
	b_16	=	Integer;			{ 16-bit quantity }
	b_32	=	LongInt;			{ 32-bit quantity }

	ip_addr	=	b_32;				{ IP address is 32-bits }

	ip_addrbytes	=	RECORD
		CASE Integer OF
			1:	(addr	:	b_32);
			2:	(byte	:	PACKED ARRAY [0..3] OF Char);
	END;
	
	wdsEntry		=	RECORD
		length		:	Integer;
		wdsBufPtr	:	Ptr;
	END;

	rdsEntry		=	RECORD
		length		:	Integer;
		rdsBufPtr	:	Ptr;
	END;

	BufferPtr		=	LongInt;

	StreamPtr		=	LongInt;

	ICMPMsgType		=	(netUnreach, hostUnreach, protocolUnreach, portUnreach,
						 fragReqd, sourceRouteFailed, timeExceeded, parmProblem,
						 missingOption);
	
	ip_port			=	Integer;

	ICMPReport		=	RECORD
		stream		:	StreamPtr;
		localHost	:	ip_addr;
		localPort	:	ip_port;
		remoteHost	:	ip_addr;
		remotePort	:	ip_port;
		reportType	:	ICMPMsgType;
		optionalAddlInfo	:	Integer;
		optionalAddlInfoPtr	:	Ptr;
	END;
	ICMPReportPtr	=	^ICMPReport;

IMPLEMENTATION

END.